﻿using System;
using System.Collections.Generic;
using System.Diagnostics.SymbolStore;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LY.OAWeb.Repository.IRepository
{
    public interface IBaseRepository<T> where T : class
    {
        /// <summary>
        /// 添加一条实体数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Insert(T entity);
        ///<summary>
        ///更新实体数据
        /// </summary>
        public bool Update(T entity);
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Delete(T entity);
        /// <summary>
        /// 删除指定的数据
        /// </summary>
        /// <param name="objet"></param>
        /// <returns></returns>
        public bool DeleteById(object objId);
        /// <summary>
        /// 根据主值查询单条数据
        /// </summary>
        /// <param name="objId"></param>
        /// <returns></returns>
        public T GetById(object objId);
        /// <summary>
        /// 获取全部数据
        /// </summary>
        /// <returns></returns>
        public List<T> GetList();
    }
}
